package com.hansming.bss.modules.sfc.alipay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016070801596289";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCP3MycIswfDcMWYO85tUm/X45QNUc8QKGgMBu7ihoLBAaUVSoUHXgDidObfpYYBROBxnz2fi1cWoDbUThVxB3mXRK0mLhOCvYIdZiuo7yKSeS/OSeH7xJBAxjq8GqbPTCFGDg6m1urGKufYMysjNbh+QYtTM3bIMvscHLusGP3flppnPfHapOZ89RLvIMzWOOz9VFapyFUBRn7O/nqKz4Qix5EW4G53ztDp7essLpsSTMkWxH4AvwYvC9weQGyZqYOT/0OvlC2S/nvxBRlIjt++CxODhPNq292QPR9TmHYXPpvMjE1qd5Evu4ctypnnMxLUXwCqblI6hvgoijvmNc7AgMBAAECggEAMhPdEZi3TzP+LeMOQxtNEZXUtyzkoB+rY1R7wtt+10jOdYHzxM7BQRIQG/eDjdbuhGUwiKlBZv2GD1IFdy1ubwsFAOKMfXYpUKaGwHv0nHq+aqYdkZ7xzrmiSd3obiNtqVbV8+iyjytmSnNqq8HW5xBFSy2KFvYipio6h8XU9oh6mM6NJEYrLA0XMmS+lvYxcCgRWaHS4Yi95F0f3aVJ3e4Va6fR2HqYalEJXLWxjYnTwSThOIw4QWMDJ0Nc2eWHvQpHZmfiHPqJmLYt1k/hhtg7GuTLcNrQ7/qfxtZYgVotq6PhYdeF9HzNa9FPwEo0VkvX0pNtBxREuAb7BG1GiQKBgQDCP+/ZMV7Bgn72Z6olMd5P9819utnZVjYFau8pRRD1WWzUSgLHjfiECZigIrSwZ0oOvpeZPXBIV3CZ9XNMjYq2wzZDT7mzU0UX10CJooHOYCSkAIEeIjh8VnoqFv/9gCSzkHWk++UnlOpz2pXcH+tpuXSdRgylKs7Hg0zz1ReU1wKBgQC9mFe7/pVzEGUnVNEI6kZbsKXOgrDfl5ss4T3mGnUKB1H1+bRKWvt/3CxiVZQlXTeYWfOEyYyODf4MHOw7rX1rL3j4XduMgs+CTgVy/LxTPC9WZhUTJErVpafvC2ApyxaiTmiNpIhPRI20GV1hVsOc+/NP5DNrdiBQceTyASygPQKBgQCsgk+lmXzHafcLKYEnSyRd7HpoQHqb0z5ijVccVaP74JEP7zKMun6L9GHBRVEmoHRap9TGWJPRCyaK9DqTL9iS+sbD/Je0tCzWQWmlUdbpyuR/aZtBga6cbchMfOSW4yi094QjIzmdb1jPzr3sIcTVvcfcrIsqW9wLv4WlvgcVPQKBgQC82sAh2jECAcXQzNK/36Uf9jDjKRmIT1rZ9K+Uwqvsxmfk7cuh+UjmDuoDNZ2xLk6PqqJAlgc1BUkWxcSmmWUB3LLSK6PjLfYHpTIWXRw2iQ/aLys0+wS0FiPWoG00lEDCgfnxhX/l/bJtQIrcx/FoMSwnW3fAxlTf7OOSEItkPQKBgFUxQFum93yNCXBbVvCEs0q9HVU5qL2sQV6kIOoOwDABbMOiqbYyktnX8SYI9EcH7z52yn+IYDRricACenaWjxTkxqrpTGAtIWAjm0xcStmkS4Opzy7jK8wvHPESP7Ltf0yEUdaIBJt9gXxKJZqAFj3ZlCq9PYgDcmB1w9/JcGtb";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj9zMnCLMHw3DFmDvObVJv1+OUDVHPEChoDAbu4oaCwQGlFUqFB14A4nTm36WGAUTgcZ89n4tXFqA21E4VcQd5l0StJi4Tgr2CHWYrqO8iknkvzknh+8SQQMY6vBqmz0whRg4Optbqxirn2DMrIzW4fkGLUzN2yDL7HBy7rBj935aaZz3x2qTmfPUS7yDM1jjs/VRWqchVAUZ+zv56is+EIseRFuBud87Q6e3rLC6bEkzJFsR+AL8GLwvcHkBsmamDk/9Dr5Qtkv578QUZSI7fvgsTg4TzatvdkD0fU5h2Fz6bzIxNaneRL7uHLcqZ5zMS1F8Aqm5SOob4KIo75jXOwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 //结果通知的页面
    public static String notify_url = "http://new.sofangche.com/pc/pay/alipay/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问（正常支付完成后支付宝跳回的页面）。不设置在支付页面就不会跳转
//	public static String return_url = "http://testsofangche.sofangche.com";

    public static String return_url = "http://new.sofangche.com/pc/my/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            System.out.println(sWord);
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

